package models

import "errors"

func Pay(cn string) (int, string, error) {
	order := Order{
		Cn: cn,
	}
	err := o.Read(&order, "cn")
	if err != nil {
		return 0, "", errors.New("该件商品不存在")
		panic("技师不存在")
	}
	o.QueryTable("order").Filter("cn", cn).One(&order)
	return order.Sum, order.Name, nil
}
